//
//  ViewController.swift
//  JKSwiftTest
//
//  Created by IronMan on 2020/9/14.
//  Copyright © 2020 Creditease. All rights reserved.
//

import UIKit

enum JKType: String {
    case normal = "0"
    case HK = "1"
    case US = "2"
}
import AdSupport
class ViewController: UIViewController {

    var type: JKType = .normal
    
    override func viewDidLoad() {
        super.viewDidLoad()
      
        self.view.backgroundColor = UIColor.brown
        
        let idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString
        let idfv = UIDevice.current.identifierForVendor?.uuidString
        let uuid = UUID().uuidString
        
        print("\n idfa= \(idfa)\n idfv= \(idfv ?? "")\n uuid = \(uuid)")
        
        
     
    }
    
    
    func test() {
        let testView = JKTestView(frame: CGRect(x: 10, y: 100, width: 200, height: 100))
        testView.clickBlock = { [weak self] in
            guard let weakSelf = self else { return }
            weakSelf.test()
        }
        testView.clickBlock = { [weak self] in
            self?.test()
        }
        view.addSubview(testView)
        
        JKPrint(type)
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        
        
        let vc = ViewController1()
        let nav = UINavigationController(rootViewController: vc)
        nav.modalPresentationStyle = .fullScreen
        present(nav, animated: true, completion: nil)
    }

}


//extension ViewController: JKTestViewDelegate {
//    func testMethod() {
//        print("代理的实现")
//    }
//}


